#import <Foundation/Foundation.h>
#import "MTTetrominosBoard.h"
#import "MTTetrominosPiece.h"

#define ORIGIN_X 4
#define ORIGIN_Y 0
#define SPAWN_X 5
#define SPAWN_Y 3

enum DIRECTION
{
	LEFT = 0,
	RIGHT = 1,
	DOWN = 2, 
	UP = 3
};



@interface MTTetrominosEngine : NSObject
{
	MTTetrominosBoard* _TetrominosBoard;
	MTTetrominosPiece* _currPiece;
	MTTetrominosPiece* _nextPiece;
	int _xPos;
	int _yPos;
	int _score;
	bool _firstRun;
	bool _done;
	float _gameSpeed;
	int _level;
}

-(void) takeTurn;
-(void) heartbeat;
-(void) startEngine;
-(void) saveStateWithFilename: (NSString*) path;
-(void) loadStateWithFilename: (NSString*) path delete: (BOOL)delFlag;
-(float) gameSpeed;
-(int) level;
-(int) score;
-(int) getPiece: (int) x: (int) y;
-(MTTetrominosPiece*) nextPiece;
-(BOOL) checkMove: (int)xBias: (int)yBias;
-(int) currPiecePiece: (int)x : (int)y;
-(void) setCurrPieceOrientation: (int) orientation;
-(void) freezePiece;
-(void) removeCompletedLines;
-(void) moveRight;
-(void) moveLeft;
-(void) rotateLeft;
-(void) rotateRight;
-(BOOL) done;
-(void) reset;
-(MTTetrominosBoard*) getField;

@end